CC=/usr/local/bin/arm-apple-darwin-cc -fnested-functions
LD=$(CC)
LDFLAGS=-Wl,-syslibroot,/Developer/SDKs/iPhone/heavenly -ObjC -framework IOKit -framework CoreFoundation -framework Foundation -framework CoreFoundation -framework UIKit -framework LayerKit -framework CoreGraphics -framework Celestial
LDFLAGS_FRAMEWORKSDIR=-F/Developer/SDKs/iphone/heavenly/System/Library/

all: iSaber

iSaber: main.o iSaber.o ViewController.o SoundHandler.o iSaberView.o
	$(LD) $(LDFLAGS) -o $@ $^

%.o:	%.m
		$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

package: iSaber
	rm -fr iSaber.app
	mkdir -p iSaber.app
	cp iSaber iSaber.app/iSaber
	cp Info.plist iSaber.app/Info.plist
	cp Default.png iSaber.app/Default.png
	cp icon.png iSaber.app/icon.png

clean:
	rm -fr *.o iSaber iSaber.app